<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
    <title>码表管理</title>
    <link rel="stylesheet" type="text/css" href="<%=path %>/web/style/layout.css" />
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/jqueryui/jquery-1.8.0.min.js"></script>
    <script type="text/javascript" src="<%=path %>/js/jquery.validate.min.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/js/DatePicker/WdatePicker.js"></script>
    <script type='text/javascript' src="<%=request.getContextPath() %>/js_css_image/js/base/jquery.form.js"></script>
    <script type="text/javascript" src="<%=request.getContextPath() %>/js/additional-methods.js"></script>
    <link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/jqueryui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/jqueryui/themes/icon.css">
	<link rel="stylesheet" type="text/css" href="<%=request.getContextPath() %>/js/jqueryui/demo.css">
	<script type="text/javascript" src="<%=request.getContextPath() %>/js/jqueryui/jquery.easyui.min.js"></script>
     <style type="text/css">
		body{
			background:#ffffff; background-image:url(images/);
		}
	</style>
	<script type="text/javascript">
    	var api = frameElement.api, W = api.opener;
    	$(function(){
    		$('#closeBtn').click(function(){
				api.close();
			}); 
    		var options = {
	    	    url:'<%=request.getContextPath() %>/autoFromsAction!saveDicviewdata.action?formid=${formid}&taskid=${taskid}',
	    	    dataType:'json',
	    	    success: function(data) {
	    	      if(data.result=='success'){
					alert("添加成功");
					api.close();
					W.reload();
	    	      }else{
	    	      	alert("系统繁忙，请您稍后再试！");
	    	      	api.close();
					W.reload();
	    	      }
    		}};
    		
			/*ajax方式提交表单*/
			$('#entry').click(function() {
		        $('#fom').ajaxSubmit(options);
		        return false; 
		    });
		    
		    var fromwidth = '${fromwidth}';
		    var fromheight = '${fromheight}';
		    if (fromwidth!='')
		    {
		    	api.config.width = fromwidth;
		    }
		    else{
		    	var columncount = '${fromColumn }';
			    if (columncount=='2')
			    {
			    	api.config.width = '1000px'
			    }
		    }
		    if (fromheight!='')
		    {
		    	api.config.height = fromheight;
		    }
    	});
    	
    	function selectperson(id)
    	{
    		var users = window.showModalDialog("<%=request.getContextPath() %>/user/chooseAllUser.jsp", window, "dialogWidth:1000px;status:no;dialogHeight:500px");
        	if (users != null) {
        		var userIds = [];
                var userNames = [];
                for(var i=0;i<users.length;i++){
                    userIds.push(users[i]['userid']);
                    userNames.push(users[i]['username']);
                }
                document.getElementById(id).value = userNames.join();
        	}
    	}
    	
    	function selectdept(id)
    	{
    		var datas = window.showModalDialog("<%=basePath%>/organization/choose_organizationIndex.jsp?temp="+Math.round(Math.random()*10000),'',"dialogWidth=900px;dialogHeight=550px");
			if(typeof(datas) == 'undefined'){
			}else{
				var json1 = eval('(' + datas + ')');
				 document.getElementById(id).value = json1.ORG_NAME;
			}
    	}
    </script>
  </head>
  
  
  <body>
  <form class="fom" id="fom" method="post" >
  		<table width="100%" border="0" align="center"  class="formTableNew">
		  ${formContent }
		</table>
		<table width="100%" border="0" align="center" class="formTableNew">
			<td align="center"  >
		    	<input id="entry" type="button" id="saveBtn" value="提 交" class="form_bt_orange" />
		      	<input type="button" id="closeBtn" value="取 消" class="form_bt_grey" />
		    </td>
		</table>
  </form>
  </body>
</html>